﻿//
// Decompiled with: Decompiler.NET, Version=1.3.1.18439, Culture=neutral, PublicKeyToken=null, Version: 1.3.1.18439
// Decompilation Started at: 3/15/2009 10:34:26 PM
// Copyright 2003 - 2004, Jungle Creatures, Inc., All Rights Reserved. 
// Written by Jonathan Pierce, Email: support@junglecreatures.com
//

namespace PatientManagement

{
		
		#region Namespace Import Declarations
		
			using System.Collections;
			using System.ComponentModel;
			using System.Data.Common;
			using System.Data;
			using System.Data.SqlClient;
			using System.Drawing;
			using System;
			using System.Resources;
			using System.Windows.Forms;
			using Utility;
			
		#endregion
		
	public class frmKQXetNghiem : Form
	
	{
		
		#region Fields
			public string _clrISN;
			public bool _insert;
			public string _SoID;
			public string _TenBenhNhan;
			private ArrayList arrCha;
			private ArrayList arrISN;
			private ArrayList arrOng;
			private ArrayList arrPltISN;
			private ArrayList arrPltName;
			private Button btAdd;
			private Button btExit;
			private Button btLuu;
			private Button btThoat;
			private Button btUpdate;
			private Button btXoa;
			private Button button1;
			private IContainer components;
			private string con;
			private int count;
			private DataGrid dataGrid1;
			private DataGrid dataGrid2;
			private Database_Com db;
			private DataGrid dgXem;
			private DataSet ds;
			private DataTable dt;
			private Label label1;
			private Label label10;
			private Label label11;
			private Label label12;
			private Label label2;
			private Label label3;
			private Label label4;
			private Label label5;
			private Label label6;
			private Label label7;
			private Label label8;
			private Label label9;
			private TreeNode node;
			private TreeNode node2;
			private TreeNode node3;
			private TreeNode node4;
			private TreeNode node5;
			private Panel panel1;
			private Panel panel2;
			private ToolTip toolTip1;
			private TreeView tvBenh;
			private TextBox txtID;
			private TextBox txtIDXem;
			private TextBox txtISN;
			private TextBox txtKetQua;
			private TextBox txtNhom;
			private TextBox txtSTT;
			private TextBox txtTenBenhNhan;
			private TextBox txtTenXem;
			private TextBox txtXetNghiem;
			private TextBox txtYeuCauXetNghiem;
		#endregion
		
		#region Constructors
		
			public frmKQXetNghiem (string SoID, string TenBenhNhan, string clrISN, bool insert)
			
			{
				SqlConnection theSqlConnection;
				SqlDataAdapter theSqlDataAdapter;
				int i;
				string theString;
				int i2;
				DataRow theDataRow;
				int i3;
				this.db = new Database_Com ();
				this.arrPltISN = new ArrayList ();
				this.arrPltName = new ArrayList ();
				this.arrCha = new ArrayList ();
				this.arrOng = new ArrayList ();
				this.arrISN = new ArrayList ();
				this.count = 0;
				this._SoID = SoID;
				this._TenBenhNhan = TenBenhNhan;
				this._clrISN = clrISN;
				this._insert = insert;
				this.InitializeComponent ();
				this.con = Connection.ConnectionString ();
				this.dt = new DataTable ("XetNghiemList");
				DataColumn theDataColumn = this.dt.Columns.Add ("STT");
				DataColumn theDataColumn2 = this.dt.Columns.Add ("Loại");
				DataColumn theDataColumn3 = this.dt.Columns.Add ("Nhóm");
				DataColumn theDataColumn4 = this.dt.Columns.Add ("Xét Nghiệm");
				DataColumn theDataColumn5 = this.dt.Columns.Add ("Kết Quả");
				DataColumn theDataColumn6 = this.dt.Columns.Add ("ISN");
				this.ds = new DataSet ();
				theSqlConnection = new SqlConnection (this.con);
				theSqlDataAdapter = new SqlDataAdapter (string.Concat ("select * from vw_AnalyzeResult where clrISN = ", this._clrISN), theSqlConnection);
				int i4 = theSqlDataAdapter.Fill (this.ds, "vw_AnalyzeResult");
				theSqlDataAdapter.Dispose ();
				theSqlConnection.Close ();
				i = 0;
				goto L_019E;
				
			L_0161:
				
				{
				}
				theString = this.dt.Rows[i]["ISN"].ToString ();
				if (theString == this.txtISN.Text)
				{
					goto L_045F;
				}
				
			L_019A:
				
				{
				}
				i++;
				
			L_019E:
				
				{
				}
				if (i < this.dt.Rows.Count)
				{
					goto L_0161;
				}
				i2 = 0;
				goto L_03E6;
				
			L_01B9:
				
				{
				}
				theDataRow = this.dt.NewRow ();
				theDataRow[0] = (i3 = (i2 + 1)).ToString ();
				theDataRow[1] = this.ds.Tables["vw_AnalyzeResult"].Rows[i2]["nlpNameLevelOne"].ToString ();
				theDataRow[2] = this.ds.Tables["vw_AnalyzeResult"].Rows[i2]["nlpNameLevelTwo"].ToString ();
				theDataRow[3] = this.ds.Tables["vw_AnalyzeResult"].Rows[i2]["nlpNameLevelThree"].ToString ();
				theDataRow[4] = this.ds.Tables["vw_AnalyzeResult"].Rows[i2]["nlrResult"].ToString ();
				theDataRow[5] = this.ds.Tables["vw_AnalyzeResult"].Rows[i2]["nlpISN"].ToString ();
				if (theDataRow[1].ToString () != "")
				{
					goto L_034F;
				}
				if (theDataRow[2].ToString () != "")
				{
					goto L_034F;
				}
				theDataRow[1] = theDataRow[3].ToString ();
				theDataRow[2] = theDataRow[3].ToString ();
				
			L_034F:
				
				{
				}
				if (theDataRow[1].ToString () != "")
				{
					goto L_03CE;
				}
				if (theDataRow[2].ToString () == "")
				{
					goto L_03CE;
				}
				theDataRow[2] = this.ds.Tables["vw_AnalyzeResult"].Rows[i2]["nlpNameLevelTwo"].ToString ();
				theDataRow[1] = theDataRow[2].ToString ();
				
			L_03CE:
				
				{
				}
				this.dt.Rows.Add (theDataRow);
				i2++;
				
			L_03E6:
				
				{
				}
				if (i2 < this.ds.Tables["vw_AnalyzeResult"].Rows.Count)
				{
					goto L_01B9;
				}
				this.ds.Tables.Clear ();
				this.ds.Tables.Add (this.dt);
				this.dataGrid1.DataSource = this.ds;
				this.dataGrid1.SetDataBinding (this.ds, "XetNghiemList");
				this.loadDataGrid ();
				
			L_045F:
				return;
			}
			
		#endregion
		
		#region Methods
		
			private void btAdd_Click (object sender, EventArgs e)
			
			{
				int i;
				string theString;
				DataRow theDataRow;
				ArrayList theArrayList;
				i = 0;
				goto L_0041;
				
			L_0004:
				
				{
				}
				theString = this.dt.Rows[i]["ISN"].ToString ();
				if (theString == this.txtISN.Text)
				{
					goto L_01B9;
				}
				
			L_003D:
				
				{
				}
				i++;
				
			L_0041:
				
				{
				}
				if (i < this.dt.Rows.Count)
				{
					goto L_0004;
				}
				if (! this.check ())
				{
					goto L_01B9;
				}
				
			L_0061:
				
				{
				}
				theDataRow = this.dt.NewRow ();
				theArrayList = new ArrayList ();
				int i2 = theArrayList.Add ((this.count = (this.dt.Rows.Count + 1)).ToString ());
				int i3 = theArrayList.Add (this.txtXetNghiem.Text);
				int i4 = theArrayList.Add (this.txtNhom.Text);
				int i5 = theArrayList.Add (this.txtYeuCauXetNghiem.Text);
				int i6 = theArrayList.Add (this.txtKetQua.Text);
				int i7 = theArrayList.Add (this.txtISN.Text);
				int i8 = this.arrISN.Add (this.txtISN.Text);
				theDataRow[0] = theArrayList[0];
				theDataRow[1] = theArrayList[1];
				theDataRow[2] = theArrayList[2];
				theDataRow[3] = theArrayList[3];
				theDataRow[4] = theArrayList[4];
				theDataRow[5] = theArrayList[5];
				this.dt.Rows.Add (theDataRow);
				this.loadDataSet ();
				this.txtKetQua.Text = "";
				this.txtNhom.Text = "";
				this.txtXetNghiem.Text = "";
				this.txtYeuCauXetNghiem.Text = "";
				
			L_01B9:
				return;
			}
			
			private void btExit_Click (object sender, EventArgs e)
			
			{
				base.Close ();
				return;
			}
			
			private void btLuu_Click (object sender, EventArgs e)
			
			{
				int i;
				string theString;
				string theString2;
				string theString3;
				string[] theStringArray;
				SqlDbType[] theSqlDbTypeArray;
				object[] theObjectArray;
				if (this.dataGrid1.DataSource == null)
				{
					goto L_018F;
				}
				
			L_0012:
				
				{
				}
				if (this.ds.Tables["XetNghiemList"].Rows.Count == 0)
				{
					goto L_018F;
				}
				
			L_0038:
				
				{
				}
				if (MessageBox.Show ("Bạn có lưu xét nghiệm của bệnh nhân này không?", "Lưu Xét Nghiệm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
				{
					goto L_018F;
				}
				SqlConnection theSqlConnection = this.db.CreateConnections ();
				int i2 = this.db.Excu_NonQuery (string.Concat ("Delete AnalyzeResult Where clrISN = ", this._clrISN));
				i = 0;
				goto L_0157;
				
			L_007F:
				
				{
				}
				theString = this.ds.Tables["XetNghiemList"].Rows[i][3].ToString ();
				theString2 = this.ds.Tables["XetNghiemList"].Rows[i][4].ToString ();
				theString3 = this._clrISN;
				SqlConnection theSqlConnection2 = this.db.CreateConnections ();
				theStringArray = new string[3];
				theStringArray[0] = "@nlpName";
				theStringArray[1] = "@clrISN";
				theStringArray[2] = "@nlrResult";
				theSqlDbTypeArray = new SqlDbType[3];
				theSqlDbTypeArray[0] = SqlDbType.NVarChar;
				theSqlDbTypeArray[1] = SqlDbType.Int;
				theSqlDbTypeArray[2] = SqlDbType.NVarChar;
				theObjectArray = new object[3];
				theObjectArray[0] = theString;
				theObjectArray[1] = theString3;
				theObjectArray[2] = theString2;
				this.db.ExecuteStoredProc ("sp_AnalyzeResult_Insert", theStringArray, theSqlDbTypeArray, theObjectArray);
				i++;
				
			L_0157:
				
				{
				}
				if (i < this.ds.Tables["XetNghiemList"].Rows.Count)
				{
					goto L_007F;
				}
				DialogResult theDialogResult = MessageBox.Show ("Kết quả xét nghiệm đã lưu", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				
			L_018F:
				return;
			}
			
			private void btThoat_Click (object sender, EventArgs e)
			
			{
				base.Close ();
				return;
			}
			
			private void btUpdate_Click (object sender, EventArgs e)
			
			{
				int i;
				if (this.dataGrid1.DataSource == null)
				{
					goto L_0210;
				}
				
			L_0012:
				
				{
				}
				if (this.ds.Tables["XetNghiemList"].Rows.Count == 0)
				{
					goto L_0210;
				}
				
			L_0038:
				
				{
				}
				if (this.txtYeuCauXetNghiem.Text != "")
				{
					goto L_0067;
				}
				DialogResult theDialogResult = MessageBox.Show ("Vui lòng chọn tên xét nghiệm từ danh sách nhập", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_0210;
				
			L_0067:
				
				{
				}
				i = 0;
				goto L_01AB;
				
			L_006E:
				
				{
				}
				if (this.ds.Tables["XetNghiemList"].Rows[i]["STT"].ToString () != this.txtSTT.Text)
				{
					goto L_01A7;
				}
				this.ds.Tables["XetNghiemList"].Rows[i][1] = this.txtXetNghiem.Text;
				this.ds.Tables["XetNghiemList"].Rows[i][2] = this.txtNhom.Text;
				this.ds.Tables["XetNghiemList"].Rows[i][3] = this.txtYeuCauXetNghiem.Text;
				this.ds.Tables["XetNghiemList"].Rows[i][4] = this.txtKetQua.Text;
				this.ds.Tables["XetNghiemList"].Rows[i][5] = this.txtISN.Text;
				
			L_01A7:
				
				{
				}
				i++;
				
			L_01AB:
				
				{
				}
				if (i < this.ds.Tables["XetNghiemList"].Rows.Count)
				{
					goto L_006E;
				}
				this.txtKetQua.Text = "";
				this.txtNhom.Text = "";
				this.txtXetNghiem.Text = "";
				this.txtYeuCauXetNghiem.Text = "";
				
			L_0210:
				return;
			}
			
			private void btXoa_Click (object sender, EventArgs e)
			
			{
				int i;
				if (this.dataGrid1.DataSource == null)
				{
					goto L_017D;
				}
				
			L_0012:
				
				{
				}
				if (this.ds.Tables["XetNghiemList"].Rows.Count == 0)
				{
					goto L_017D;
				}
				
			L_0038:
				
				{
				}
				if (this.txtYeuCauXetNghiem.Text != "")
				{
					goto L_0067;
				}
				DialogResult theDialogResult = MessageBox.Show ("Vui lòng chọn tên xét nghiệm từ danh sách nhập", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_017D;
				
			L_0067:
				
				{
				}
				this.ds.Tables["XetNghiemList"].Rows[this.dataGrid1.CurrentRowIndex].Delete ();
				this.arrISN.Remove (this.txtISN.Text);
				i = 0;
				goto L_0118;
				
			L_00B0:
				
				{
				}
				if (this.ds.Tables["XetNghiemList"].Rows.Count != 0)
				{
					goto L_00E2;
				}
				this.dataGrid1.DataSource = null;
				goto L_017D;
				
			L_00E2:
				
				{
				}
				this.ds.Tables["XetNghiemList"].Rows[i]["STT"] = (i + 1);
				i++;
				
			L_0118:
				
				{
				}
				if (i < this.ds.Tables["XetNghiemList"].Rows.Count)
				{
					goto L_00B0;
				}
				this.txtKetQua.Text = "";
				this.txtNhom.Text = "";
				this.txtXetNghiem.Text = "";
				this.txtYeuCauXetNghiem.Text = "";
				
			L_017D:
				return;
			}
			
			public bool check ()
			
			{
				bool theBoolean;
				if (this.txtYeuCauXetNghiem.Text != "")
				{
					goto L_002E;
				}
				DialogResult theDialogResult = MessageBox.Show ("Vui lòng chọn mẫu xét nghiệm từ danh sách nhập", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				theBoolean = false;
				goto L_0060;
				
			L_002E:
				
				{
				}
				if (this.txtKetQua.Text != "")
				{
					goto L_005C;
				}
				DialogResult theDialogResult2 = MessageBox.Show ("Vui lòng nhập kết quả", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				theBoolean = false;
				goto L_0060;
				
			L_005C:
				
				{
				}
				theBoolean = true;
				goto L_0060;
				
			L_0060:
				
				{
				}
				return theBoolean;
			}
			
			private void dataGrid1_MouseUp (object sender, MouseEventArgs e)
			
			{
				DataGrid.HitTestInfo theHitTestInfo;
				if (this.dataGrid1.DataSource == null)
				{
					goto L_01DA;
				}
				
			L_0012:
				
				{
				}
				if (e.Button != MouseButtons.Left)
				{
					goto L_01DA;
				}
				theHitTestInfo = this.dataGrid1.HitTest (e.X, e.Y);
				if (theHitTestInfo.Type != System.Windows.Forms.DataGrid.HitTestType.RowHeader)
				{
					goto L_01DA;
				}
				this.txtXetNghiem.Text = this.ds.Tables["XetNghiemList"].Rows[this.dataGrid1.CurrentRowIndex]["Loại"].ToString ();
				this.txtYeuCauXetNghiem.Text = this.ds.Tables["XetNghiemList"].Rows[this.dataGrid1.CurrentRowIndex]["Xét Nghiệm"].ToString ();
				this.txtNhom.Text = this.ds.Tables["XetNghiemList"].Rows[this.dataGrid1.CurrentRowIndex]["Nhóm"].ToString ();
				this.txtKetQua.Text = this.ds.Tables["XetNghiemList"].Rows[this.dataGrid1.CurrentRowIndex]["Kết Quả"].ToString ();
				this.txtSTT.Text = this.ds.Tables["XetNghiemList"].Rows[this.dataGrid1.CurrentRowIndex]["STT"].ToString ();
				this.txtISN.Text = this.ds.Tables["XetNghiemList"].Rows[this.dataGrid1.CurrentRowIndex][5].ToString ();
				
			L_01DA:
				return;
			}
			
			protected override void Dispose (bool disposing)
			
			{
				if (! disposing)
				{
					goto L_0016;
				}
				if (this.components == null)
				{
					goto L_0016;
				}
				this.components.Dispose ();
				
			L_0016:
				
				{
				}
				base.Dispose (disposing);
				return;
			}
			
			private void frmKQXetNghiem_Load (object sender, EventArgs e)
			
			{
				SqlConnection theSqlConnection;
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				int i;
				if (! this._insert)
				{
					goto L_004D;
				}
				this.panel1.Visible = true;
				this.panel2.Visible = false;
				this.txtID.Text = this._SoID;
				this.txtTenBenhNhan.Text = this._TenBenhNhan;
				this.LoadXetNghiem ();
				goto L_0195;
				
			L_004D:
				
				{
				}
				this.panel1.Visible = false;
				this.panel2.Visible = true;
				this.txtIDXem.Text = this._SoID;
				this.txtTenXem.Text = this._TenBenhNhan;
				base.Height = 400;
				base.Width = 700;
				theSqlConnection = new SqlConnection (this.con);
				theSqlDataAdapter = new SqlDataAdapter (string.Concat ("select * from vw_AnalyzeResult where clrISN = ", this._clrISN), theSqlConnection);
				theDataSet = new DataSet ();
				int i2 = theSqlDataAdapter.Fill (theDataSet, "vw_AnalyzeResult");
				if ((theDataSet != null) && ((theDataSet.Tables.Count != 0) && (theDataSet.Tables["vw_AnalyzeResult"].Rows.Count != 0)))
				{
					goto L_0104;
				}
				
			L_00FF:
				
				{
				}
				goto L_0195;
				
			L_0104:
				
				{
				}
				i = 0;
				goto L_0139;
				
			L_0108:
				
				{
				}
				theDataSet.Tables["vw_AnalyzeResult"].Rows[i]["nlpISNLevelOne"] = (i + 1);
				i++;
				
			L_0139:
				
				{
				}
				if (i < theDataSet.Tables["vw_AnalyzeResult"].Rows.Count)
				{
					goto L_0108;
				}
				theSqlDataAdapter.Dispose ();
				theSqlConnection.Close ();
				this.dgXem.DataSource = theDataSet;
				this.dgXem.SetDataBinding (theDataSet, "vw_AnalyzeResult");
				this.dgXem.TableStyles.Clear ();
				this.loadDataGrid2 ();
				
			L_0195:
				return;
			}
			
			private void InitializeComponent ()
			
			{
				ResourceManager theResourceManager;
				Control[] theControlArray;
				Control[] theControlArray2;
				Control[] theControlArray3;
				this.components = ((IContainer) new System.ComponentModel.Container ());
				theResourceManager = new ResourceManager (typeof (frmKQXetNghiem));
				this.label7 = new Label ();
				this.txtTenBenhNhan = new TextBox ();
				this.txtID = new TextBox ();
				this.label2 = new Label ();
				this.label3 = new Label ();
				this.txtXetNghiem = new TextBox ();
				this.label4 = new Label ();
				this.txtNhom = new TextBox ();
				this.label5 = new Label ();
				this.txtYeuCauXetNghiem = new TextBox ();
				this.label6 = new Label ();
				this.txtKetQua = new TextBox ();
				this.label8 = new Label ();
				this.btAdd = new Button ();
				this.btXoa = new Button ();
				this.btUpdate = new Button ();
				this.dataGrid1 = new DataGrid ();
				this.label9 = new Label ();
				this.btLuu = new Button ();
				this.btThoat = new Button ();
				this.tvBenh = new TreeView ();
				this.txtSTT = new TextBox ();
				this.panel1 = new Panel ();
				this.txtISN = new TextBox ();
				this.label1 = new Label ();
				this.dataGrid2 = new DataGrid ();
				this.button1 = new Button ();
				this.panel2 = new Panel ();
				this.label11 = new Label ();
				this.txtTenXem = new TextBox ();
				this.txtIDXem = new TextBox ();
				this.label12 = new Label ();
				this.btExit = new Button ();
				this.label10 = new Label ();
				this.dgXem = new DataGrid ();
				this.toolTip1 = new ToolTip (this.components);
				((ISupportInitialize) this.dataGrid1).BeginInit ();
				this.panel1.SuspendLayout ();
				((ISupportInitialize) this.dataGrid2).BeginInit ();
				this.panel2.SuspendLayout ();
				((ISupportInitialize) this.dgXem).BeginInit ();
				base.SuspendLayout ();
				this.label7.Font = new System.Drawing.Font ("Verdana", 12F, FontStyle.Bold, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label7.ForeColor = Color.MediumBlue;
				this.label7.Location = new Point (248, 8);
				this.label7.Name = "label7";
				this.label7.Size = new System.Drawing.Size (192, 23);
				this.label7.TabIndex = 18;
				this.label7.Text = "Phiếu Xét Nghiệm";
				this.label7.TextAlign = ContentAlignment.MiddleCenter;
				this.txtTenBenhNhan.BorderStyle = BorderStyle.FixedSingle;
				this.txtTenBenhNhan.ForeColor = SystemColors.HotTrack;
				this.txtTenBenhNhan.Location = new Point (424, 72);
				this.txtTenBenhNhan.Name = "txtTenBenhNhan";
				this.txtTenBenhNhan.Size = new System.Drawing.Size (208, 23);
				this.txtTenBenhNhan.TabIndex = 2;
				this.txtTenBenhNhan.Text = "";
				this.txtTenBenhNhan.KeyPress += new KeyPressEventHandler (this.txtNhom_KeyPress);
				this.txtID.BorderStyle = BorderStyle.FixedSingle;
				this.txtID.ForeColor = SystemColors.HotTrack;
				this.txtID.Location = new Point (424, 48);
				this.txtID.Name = "txtID";
				this.txtID.Size = new System.Drawing.Size (104, 23);
				this.txtID.TabIndex = 1;
				this.txtID.Text = "";
				this.txtID.KeyPress += new KeyPressEventHandler (this.txtNhom_KeyPress);
				this.label2.Location = new Point (359, 48);
				this.label2.Name = "label2";
				this.label2.Size = new System.Drawing.Size (64, 23);
				this.label2.TabIndex = 34;
				this.label2.Text = "Số ID:";
				this.label2.TextAlign = ContentAlignment.MiddleRight;
				this.label3.Location = new Point (295, 72);
				this.label3.Name = "label3";
				this.label3.Size = new System.Drawing.Size (128, 23);
				this.label3.TabIndex = 35;
				this.label3.Text = "Tên bệnh nhân:";
				this.label3.TextAlign = ContentAlignment.MiddleRight;
				this.txtXetNghiem.BorderStyle = BorderStyle.FixedSingle;
				this.txtXetNghiem.ForeColor = SystemColors.HotTrack;
				this.txtXetNghiem.Location = new Point (424, 96);
				this.txtXetNghiem.Name = "txtXetNghiem";
				this.txtXetNghiem.Size = new System.Drawing.Size (208, 23);
				this.txtXetNghiem.TabIndex = 4;
				this.txtXetNghiem.Text = "";
				this.txtXetNghiem.KeyPress += new KeyPressEventHandler (this.txtNhom_KeyPress);
				this.label4.Location = new Point (297, 96);
				this.label4.Name = "label4";
				this.label4.Size = new System.Drawing.Size (128, 23);
				this.label4.TabIndex = 39;
				this.label4.Text = "Loại xét nghiệm:";
				this.label4.TextAlign = ContentAlignment.MiddleRight;
				this.txtNhom.BorderStyle = BorderStyle.FixedSingle;
				this.txtNhom.ForeColor = SystemColors.HotTrack;
				this.txtNhom.Location = new Point (424, 120);
				this.txtNhom.Name = "txtNhom";
				this.txtNhom.Size = new System.Drawing.Size (208, 23);
				this.txtNhom.TabIndex = 5;
				this.txtNhom.Text = "";
				this.txtNhom.KeyPress += new KeyPressEventHandler (this.txtNhom_KeyPress);
				this.label5.Location = new Point (296, 120);
				this.label5.Name = "label5";
				this.label5.Size = new System.Drawing.Size (128, 23);
				this.label5.TabIndex = 41;
				this.label5.Text = "Nhóm:";
				this.label5.TextAlign = ContentAlignment.MiddleRight;
				this.txtYeuCauXetNghiem.BorderStyle = BorderStyle.FixedSingle;
				this.txtYeuCauXetNghiem.ForeColor = SystemColors.HotTrack;
				this.txtYeuCauXetNghiem.Location = new Point (424, 144);
				this.txtYeuCauXetNghiem.Name = "txtYeuCauXetNghiem";
				this.txtYeuCauXetNghiem.Size = new System.Drawing.Size (208, 23);
				this.txtYeuCauXetNghiem.TabIndex = 6;
				this.txtYeuCauXetNghiem.Text = "";
				this.txtYeuCauXetNghiem.KeyPress += new KeyPressEventHandler (this.txtNhom_KeyPress);
				this.label6.Location = new Point (271, 144);
				this.label6.Name = "label6";
				this.label6.Size = new System.Drawing.Size (152, 23);
				this.label6.TabIndex = 43;
				this.label6.Text = "Yêu cầu xét nghiệm:";
				this.label6.TextAlign = ContentAlignment.MiddleRight;
				this.txtKetQua.BorderStyle = BorderStyle.FixedSingle;
				this.txtKetQua.ForeColor = SystemColors.HotTrack;
				this.txtKetQua.Location = new Point (424, 168);
				this.txtKetQua.Multiline = true;
				this.txtKetQua.Name = "txtKetQua";
				this.txtKetQua.ScrollBars = ScrollBars.Vertical;
				this.txtKetQua.Size = new System.Drawing.Size (208, 80);
				this.txtKetQua.TabIndex = 7;
				this.txtKetQua.Text = "";
				this.label8.Location = new Point (333, 168);
				this.label8.Name = "label8";
				this.label8.Size = new System.Drawing.Size (88, 23);
				this.label8.TabIndex = 45;
				this.label8.Text = "Kết Quả:";
				this.label8.TextAlign = ContentAlignment.MiddleRight;
				this.btAdd.FlatStyle = FlatStyle.Popup;
				this.btAdd.Location = new Point (424, 252);
				this.btAdd.Name = "btAdd";
				this.btAdd.Size = new System.Drawing.Size (48, 23);
				this.btAdd.TabIndex = 8;
				this.btAdd.Text = "Nhập";
				this.btAdd.Click += new EventHandler (this.btAdd_Click);
				this.btXoa.FlatStyle = FlatStyle.Popup;
				this.btXoa.Location = new Point (568, 252);
				this.btXoa.Name = "btXoa";
				this.btXoa.Size = new System.Drawing.Size (64, 23);
				this.btXoa.TabIndex = 10;
				this.btXoa.Text = "Xóa";
				this.btXoa.Click += new EventHandler (this.btXoa_Click);
				this.btUpdate.FlatStyle = FlatStyle.Popup;
				this.btUpdate.Location = new Point (480, 252);
				this.btUpdate.Name = "btUpdate";
				this.btUpdate.Size = new System.Drawing.Size (80, 23);
				this.btUpdate.TabIndex = 9;
				this.btUpdate.Text = "Cập Nhật";
				this.btUpdate.Click += new EventHandler (this.btUpdate_Click);
				this.dataGrid1.BackgroundColor = SystemColors.ActiveCaptionText;
				this.dataGrid1.CaptionVisible = false;
				this.dataGrid1.DataMember = "";
				this.dataGrid1.HeaderForeColor = SystemColors.ControlText;
				this.dataGrid1.Location = new Point (8, 310);
				this.dataGrid1.Name = "dataGrid1";
				this.dataGrid1.ReadOnly = true;
				this.dataGrid1.Size = new System.Drawing.Size (664, 200);
				this.dataGrid1.TabIndex = 11;
				this.dataGrid1.MouseUp += new MouseEventHandler (this.dataGrid1_MouseUp);
				this.label9.Font = new System.Drawing.Font ("Verdana", 12F, FontStyle.Bold, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label9.ForeColor = Color.MediumBlue;
				this.label9.Location = new Point (227, 282);
				this.label9.Name = "label9";
				this.label9.Size = new System.Drawing.Size (224, 23);
				this.label9.TabIndex = 68;
				this.label9.Text = "Kết Quả Xét Nghiệm";
				this.label9.TextAlign = ContentAlignment.MiddleCenter;
				this.btLuu.FlatStyle = FlatStyle.Popup;
				this.btLuu.Location = new Point (503, 515);
				this.btLuu.Name = "btLuu";
				this.btLuu.Size = new System.Drawing.Size (80, 23);
				this.btLuu.TabIndex = 12;
				this.btLuu.Text = "Lưu";
				this.btLuu.Click += new EventHandler (this.btLuu_Click);
				this.btThoat.FlatStyle = FlatStyle.Popup;
				this.btThoat.Location = new Point (591, 515);
				this.btThoat.Name = "btThoat";
				this.btThoat.Size = new System.Drawing.Size (80, 23);
				this.btThoat.TabIndex = 13;
				this.btThoat.Text = "Thoát";
				this.btThoat.Click += new EventHandler (this.btThoat_Click);
				this.tvBenh.BorderStyle = BorderStyle.FixedSingle;
				this.tvBenh.Font = new System.Drawing.Font ("Verdana", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.tvBenh.ImageIndex = -1;
				this.tvBenh.Location = new Point (32, 48);
				this.tvBenh.Name = "tvBenh";
				this.tvBenh.SelectedImageIndex = -1;
				this.tvBenh.Size = new System.Drawing.Size (216, 232);
				this.tvBenh.TabIndex = 69;
				this.tvBenh.DoubleClick += new EventHandler (this.tvBenh_DoubleClick);
				this.txtSTT.BorderStyle = BorderStyle.FixedSingle;
				this.txtSTT.ForeColor = SystemColors.HotTrack;
				this.txtSTT.Location = new Point (576, 48);
				this.txtSTT.Name = "txtSTT";
				this.txtSTT.Size = new System.Drawing.Size (56, 23);
				this.txtSTT.TabIndex = 70;
				this.txtSTT.Text = "";
				this.txtSTT.Visible = false;
				theControlArray = new Control[26];
				theControlArray[0] = ((Control) this.txtISN);
				theControlArray[1] = ((Control) this.label1);
				theControlArray[2] = ((Control) this.dataGrid2);
				theControlArray[3] = ((Control) this.button1);
				theControlArray[4] = ((Control) this.tvBenh);
				theControlArray[5] = ((Control) this.label3);
				theControlArray[6] = ((Control) this.txtTenBenhNhan);
				theControlArray[7] = ((Control) this.btAdd);
				theControlArray[8] = ((Control) this.txtID);
				theControlArray[9] = ((Control) this.txtXetNghiem);
				theControlArray[10] = ((Control) this.btXoa);
				theControlArray[11] = ((Control) this.label2);
				theControlArray[12] = ((Control) this.btUpdate);
				theControlArray[13] = ((Control) this.label4);
				theControlArray[14] = ((Control) this.txtSTT);
				theControlArray[15] = ((Control) this.txtNhom);
				theControlArray[16] = ((Control) this.label5);
				theControlArray[17] = ((Control) this.txtYeuCauXetNghiem);
				theControlArray[18] = ((Control) this.label6);
				theControlArray[19] = ((Control) this.label7);
				theControlArray[20] = ((Control) this.txtKetQua);
				theControlArray[21] = ((Control) this.label8);
				theControlArray[22] = ((Control) this.label9);
				theControlArray[23] = ((Control) this.dataGrid1);
				theControlArray[24] = ((Control) this.btLuu);
				theControlArray[25] = ((Control) this.btThoat);
				this.panel1.Controls.AddRange (theControlArray);
				this.panel1.Name = "panel1";
				this.panel1.Size = new System.Drawing.Size (680, 544);
				this.panel1.TabIndex = 71;
				this.txtISN.BorderStyle = BorderStyle.FixedSingle;
				this.txtISN.ForeColor = SystemColors.HotTrack;
				this.txtISN.Location = new Point (359, 252);
				this.txtISN.Name = "txtISN";
				this.txtISN.Size = new System.Drawing.Size (56, 23);
				this.txtISN.TabIndex = 75;
				this.txtISN.Text = "";
				this.txtISN.Visible = false;
				this.label1.Font = new System.Drawing.Font ("Verdana", 12F, FontStyle.Bold, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label1.ForeColor = Color.MediumBlue;
				this.label1.Location = new Point (227, 648);
				this.label1.Name = "label1";
				this.label1.Size = new System.Drawing.Size (224, 23);
				this.label1.TabIndex = 73;
				this.label1.Text = "Kết Quả Xét Nghiệm";
				this.label1.TextAlign = ContentAlignment.MiddleCenter;
				this.dataGrid2.BackgroundColor = SystemColors.ActiveCaptionText;
				this.dataGrid2.CaptionVisible = false;
				this.dataGrid2.DataMember = "";
				this.dataGrid2.HeaderForeColor = SystemColors.ControlText;
				this.dataGrid2.Location = new Point (8, 672);
				this.dataGrid2.Name = "dataGrid2";
				this.dataGrid2.ReadOnly = true;
				this.dataGrid2.Size = new System.Drawing.Size (664, 108);
				this.dataGrid2.TabIndex = 71;
				this.button1.FlatStyle = FlatStyle.Popup;
				this.button1.Location = new Point (592, 792);
				this.button1.Name = "button1";
				this.button1.Size = new System.Drawing.Size (80, 23);
				this.button1.TabIndex = 72;
				this.button1.Text = "Thoát";
				theControlArray2 = new Control[7];
				theControlArray2[0] = ((Control) this.label11);
				theControlArray2[1] = ((Control) this.txtTenXem);
				theControlArray2[2] = ((Control) this.txtIDXem);
				theControlArray2[3] = ((Control) this.label12);
				theControlArray2[4] = ((Control) this.btExit);
				theControlArray2[5] = ((Control) this.label10);
				theControlArray2[6] = ((Control) this.dgXem);
				this.panel2.Controls.AddRange (theControlArray2);
				this.panel2.Name = "panel2";
				this.panel2.Size = new System.Drawing.Size (680, 360);
				this.panel2.TabIndex = 72;
				this.label11.Location = new Point (172, 62);
				this.label11.Name = "label11";
				this.label11.Size = new System.Drawing.Size (128, 23);
				this.label11.TabIndex = 79;
				this.label11.Text = "Tên bệnh nhân:";
				this.label11.TextAlign = ContentAlignment.MiddleRight;
				this.txtTenXem.BorderStyle = BorderStyle.FixedSingle;
				this.txtTenXem.ForeColor = SystemColors.HotTrack;
				this.txtTenXem.Location = new Point (300, 62);
				this.txtTenXem.Name = "txtTenXem";
				this.txtTenXem.Size = new System.Drawing.Size (208, 23);
				this.txtTenXem.TabIndex = 77;
				this.txtTenXem.Text = "";
				this.txtTenXem.KeyPress += new KeyPressEventHandler (this.txtNhom_KeyPress);
				this.txtIDXem.BorderStyle = BorderStyle.FixedSingle;
				this.txtIDXem.ForeColor = SystemColors.HotTrack;
				this.txtIDXem.Location = new Point (300, 38);
				this.txtIDXem.Name = "txtIDXem";
				this.txtIDXem.Size = new System.Drawing.Size (104, 23);
				this.txtIDXem.TabIndex = 76;
				this.txtIDXem.Text = "";
				this.txtIDXem.KeyPress += new KeyPressEventHandler (this.txtNhom_KeyPress);
				this.label12.Location = new Point (236, 38);
				this.label12.Name = "label12";
				this.label12.Size = new System.Drawing.Size (64, 23);
				this.label12.TabIndex = 78;
				this.label12.Text = "Số ID:";
				this.label12.TextAlign = ContentAlignment.MiddleRight;
				this.btExit.FlatStyle = FlatStyle.Popup;
				this.btExit.Location = new Point (592, 328);
				this.btExit.Name = "btExit";
				this.btExit.Size = new System.Drawing.Size (80, 23);
				this.btExit.TabIndex = 74;
				this.btExit.Text = "Thoát";
				this.btExit.Click += new EventHandler (this.btExit_Click);
				this.label10.Font = new System.Drawing.Font ("Verdana", 12F, FontStyle.Bold, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label10.ForeColor = Color.MediumBlue;
				this.label10.Location = new Point (240, 8);
				this.label10.Name = "label10";
				this.label10.Size = new System.Drawing.Size (224, 23);
				this.label10.TabIndex = 75;
				this.label10.Text = "Danh Sách Xét Nghiệm";
				this.label10.TextAlign = ContentAlignment.MiddleCenter;
				this.dgXem.BackgroundColor = SystemColors.ActiveCaptionText;
				this.dgXem.CaptionVisible = false;
				this.dgXem.DataMember = "";
				this.dgXem.HeaderForeColor = SystemColors.ControlText;
				this.dgXem.Location = new Point (8, 88);
				this.dgXem.Name = "dgXem";
				this.dgXem.ReadOnly = true;
				this.dgXem.Size = new System.Drawing.Size (664, 232);
				this.dgXem.TabIndex = 74;
				this.AutoScaleBaseSize = new System.Drawing.Size (7, 16);
				base.ClientSize = new System.Drawing.Size (686, 549);
				theControlArray3 = new Control[2];
				theControlArray3[0] = ((Control) this.panel1);
				theControlArray3[1] = ((Control) this.panel2);
				base.Controls.AddRange (theControlArray3);
				this.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
				base.Icon = ((System.Drawing.Icon) theResourceManager.GetObject ("$this.Icon"));
				base.MaximizeBox = false;
				base.MinimizeBox = false;
				base.Name = "frmKQXetNghiem";
				base.StartPosition = FormStartPosition.CenterScreen;
				this.Text = "Xét Nghiệm";
				base.Load += new EventHandler (this.frmKQXetNghiem_Load);
				((ISupportInitialize) this.dataGrid1).EndInit ();
				this.panel1.ResumeLayout (false);
				((ISupportInitialize) this.dataGrid2).EndInit ();
				this.panel2.ResumeLayout (false);
				((ISupportInitialize) this.dgXem).EndInit ();
				base.ResumeLayout (false);
				return;
			}
			
			private void insertChildNode (string strName, DataRow row)
			
			{
				this.node2 = ((TreeNode) new MyNode (row));
				this.node2.Text = strName;
				return;
			}
			
			private void insertChildNode3 (string strName, DataRow row)
			
			{
				this.node3 = ((TreeNode) new MyNode (row));
				this.node3.Text = strName;
				return;
			}
			
			private void insertChildNode4 (string strName, DataRow row)
			
			{
				this.node4 = ((TreeNode) new MyNode (row));
				this.node4.Text = strName;
				return;
			}
			
			private void insertChildNode5 (string strName, DataRow row)
			
			{
				this.node5 = ((TreeNode) new MyNode (row));
				this.node5.Text = strName;
				return;
			}
			
			private void insertParentNode (string strName, DataRow row)
			
			{
				this.node = ((TreeNode) new MyNode (row));
				this.node.Text = strName;
				return;
			}
			
			public void loadDataGrid ()
			
			{
				DataGridTableStyle theDataGridTableStyle;
				DataGridTextBoxColumn theDataGridTextBoxColumn;
				DataGridTextBoxColumn theDataGridTextBoxColumn2;
				DataGridTextBoxColumn theDataGridTextBoxColumn3;
				DataGridTextBoxColumn theDataGridTextBoxColumn4;
				DataGridTextBoxColumn theDataGridTextBoxColumn5;
				DataGridTextBoxColumn theDataGridTextBoxColumn6;
				theDataGridTableStyle = new DataGridTableStyle ();
				theDataGridTableStyle.MappingName = "XetNghiemList";
				theDataGridTableStyle.AlternatingBackColor = Color.AliceBlue;
				theDataGridTableStyle.HeaderForeColor = Color.Maroon;
				theDataGridTableStyle.GridLineColor = Color.CornflowerBlue;
				theDataGridTextBoxColumn = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn.MappingName = "STT";
				theDataGridTextBoxColumn.HeaderText = " STT";
				theDataGridTextBoxColumn.Width = 50;
				int i = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn));
				theDataGridTextBoxColumn.Alignment = HorizontalAlignment.Center;
				theDataGridTextBoxColumn2 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn2.MappingName = "Loại";
				theDataGridTextBoxColumn2.HeaderText = "      Loại Xét Nghiệm";
				theDataGridTextBoxColumn2.Width = 180;
				theDataGridTextBoxColumn2.NullText = string.Empty;
				int i2 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn2));
				theDataGridTextBoxColumn2.Alignment = HorizontalAlignment.Center;
				theDataGridTextBoxColumn3 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn3.MappingName = "Nhóm";
				theDataGridTextBoxColumn3.HeaderText = "        Nhóm";
				theDataGridTextBoxColumn3.Width = 150;
				theDataGridTextBoxColumn3.NullText = string.Empty;
				theDataGridTextBoxColumn3.Alignment = HorizontalAlignment.Center;
				int i3 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn3));
				theDataGridTextBoxColumn4 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn4.MappingName = "Xét Nghiêm";
				theDataGridTextBoxColumn4.HeaderText = "  Xét Nghiệm";
				theDataGridTextBoxColumn4.Width = 120;
				theDataGridTextBoxColumn4.NullText = string.Empty;
				theDataGridTextBoxColumn4.Alignment = HorizontalAlignment.Center;
				int i4 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn4));
				theDataGridTextBoxColumn5 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn5.MappingName = "Kết Quả";
				theDataGridTextBoxColumn5.HeaderText = "       Kết Quả";
				theDataGridTextBoxColumn5.Width = 180;
				theDataGridTextBoxColumn5.NullText = string.Empty;
				theDataGridTextBoxColumn5.Alignment = HorizontalAlignment.Center;
				int i5 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn5));
				theDataGridTextBoxColumn6 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn6.MappingName = "ISN";
				theDataGridTextBoxColumn6.HeaderText = "";
				theDataGridTextBoxColumn6.Width = 0;
				theDataGridTextBoxColumn6.NullText = string.Empty;
				theDataGridTextBoxColumn6.Alignment = HorizontalAlignment.Center;
				int i6 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn6));
				int i7 = this.dataGrid1.TableStyles.Add (theDataGridTableStyle);
				theDataGridTableStyle.AllowSorting = false;
				return;
			}
			
			public void loadDataGrid2 ()
			
			{
				DataGridTableStyle theDataGridTableStyle;
				DataGridTextBoxColumn theDataGridTextBoxColumn;
				DataGridTextBoxColumn theDataGridTextBoxColumn2;
				DataGridTextBoxColumn theDataGridTextBoxColumn3;
				DataGridTextBoxColumn theDataGridTextBoxColumn4;
				DataGridTextBoxColumn theDataGridTextBoxColumn5;
				theDataGridTableStyle = new DataGridTableStyle ();
				theDataGridTableStyle.MappingName = "vw_AnalyzeResult";
				theDataGridTableStyle.AlternatingBackColor = Color.AliceBlue;
				theDataGridTableStyle.HeaderForeColor = Color.Maroon;
				theDataGridTableStyle.GridLineColor = Color.CornflowerBlue;
				theDataGridTextBoxColumn = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn.MappingName = "nlpISNLevelOne";
				theDataGridTextBoxColumn.HeaderText = " STT";
				theDataGridTextBoxColumn.Width = 50;
				int i = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn));
				theDataGridTextBoxColumn.Alignment = HorizontalAlignment.Center;
				theDataGridTextBoxColumn2 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn2.MappingName = "nlpNameLevelOne";
				theDataGridTextBoxColumn2.HeaderText = "      Loại Xét Nghiệm";
				theDataGridTextBoxColumn2.Width = 180;
				theDataGridTextBoxColumn2.NullText = string.Empty;
				int i2 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn2));
				theDataGridTextBoxColumn2.Alignment = HorizontalAlignment.Center;
				theDataGridTextBoxColumn3 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn3.MappingName = "nlpNameLevelTwo";
				theDataGridTextBoxColumn3.HeaderText = "         Nhóm";
				theDataGridTextBoxColumn3.Width = 150;
				theDataGridTextBoxColumn3.NullText = string.Empty;
				theDataGridTextBoxColumn3.Alignment = HorizontalAlignment.Center;
				int i3 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn3));
				theDataGridTextBoxColumn4 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn4.MappingName = "nlpNameLevelThree";
				theDataGridTextBoxColumn4.HeaderText = "  Xét Nghiệm";
				theDataGridTextBoxColumn4.Width = 120;
				theDataGridTextBoxColumn4.NullText = string.Empty;
				theDataGridTextBoxColumn4.Alignment = HorizontalAlignment.Center;
				int i4 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn4));
				theDataGridTextBoxColumn5 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn5.MappingName = "nlrResult";
				theDataGridTextBoxColumn5.HeaderText = "       Kết Quả";
				theDataGridTextBoxColumn5.Width = 180;
				theDataGridTextBoxColumn5.NullText = string.Empty;
				theDataGridTextBoxColumn5.Alignment = HorizontalAlignment.Center;
				int i5 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn5));
				int i6 = this.dgXem.TableStyles.Add (theDataGridTableStyle);
				theDataGridTableStyle.AllowSorting = false;
				return;
			}
			
			public void loadDataSet ()
			
			{
				this.ds.Tables.Clear ();
				this.ds.Tables.Add (this.dt);
				this.dataGrid1.TableStyles.Clear ();
				this.dataGrid1.DataSource = this.ds;
				this.dataGrid1.SetDataBinding (this.ds, "XetNghiemList");
				this.loadDataGrid ();
				return;
			}
			
			private void LoadXetNghiem ()
			
			{
				SqlConnection theSqlConnection;
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				DataTable theDataTable;
				int i;
				int i2;
				SqlDataAdapter theSqlDataAdapter2;
				DataSet theDataSet2;
				int i3;
				SqlDataAdapter theSqlDataAdapter3;
				DataSet theDataSet3;
				int i4;
				SqlDataAdapter theSqlDataAdapter4;
				DataSet theDataSet4;
				int i5;
				SqlDataAdapter theSqlDataAdapter5;
				DataSet theDataSet5;
				int i6;
				this.arrPltISN.Clear ();
				this.arrPltName.Clear ();
				this.arrCha.Clear ();
				theSqlConnection = new SqlConnection (this.con);
				theSqlDataAdapter = new SqlDataAdapter ("select distinct nlpISNLevelOne,nlpNameLevelOne from vw_AnalyzeTree where nlpName"
				+ "LevelOne is not null order by nlpNameLevelOne", theSqlConnection);
				theDataSet = new DataSet ();
				int i7 = theSqlDataAdapter.Fill (theDataSet, "vw_AnalyzeTree");
				if (theDataSet == null)
				{
					goto L_0608;
				}
				
			L_0054:
				
				{
				}
				theDataTable = theDataSet.Tables["vw_AnalyzeTree"];
				i = 0;
				goto L_00B8;
				
			L_006A:
				
				{
				}
				int i8 = this.arrPltISN.Add (theDataTable.Rows[i][0].ToString ());
				int i9 = this.arrPltName.Add (theDataTable.Rows[i][1].ToString ());
				i++;
				
			L_00B8:
				
				{
				}
				if (i < theDataTable.Rows.Count)
				{
					goto L_006A;
				}
				i2 = 0;
				goto L_05DF;
				
			L_00CF:
				
				{
				}
				this.insertParentNode (this.arrPltName[i2].ToString (), theDataTable.Rows[i2]);
				int i10 = this.arrOng.Add (this.arrPltName[i2].ToString ());
				int i11 = this.tvBenh.Nodes.Add (this.node);
				theSqlDataAdapter2 = new SqlDataAdapter (string.Concat ("SELECT distinct nlpISNLevelTwo,nlpNameLeveltwo FROM vw_AnalyzeTree WHERE nlpISNL"
				+ "evelOne=", this.arrPltISN[i2].ToString (), " and nlpNameLeveltwo is not null order by nlpNameLevelTwo"), theSqlConnection);
				theDataSet2 = new DataSet ();
				int i12 = theSqlDataAdapter2.Fill (theDataSet2, "Two");
				i3 = 0;
				goto L_05B0;
				
			L_0170:
				
				{
				}
				this.tvBenh.SelectedNode = this.node;
				this.arrOng.Remove (this.arrPltName[i2].ToString ());
				this.insertChildNode (theDataSet2.Tables["Two"].Rows[i3]["nlpNameLevelTwo"].ToString (), theDataSet2.Tables["Two"].Rows[i3]);
				int i13 = this.tvBenh.SelectedNode.Nodes.Add (this.node2);
				int i14 = this.arrCha.Add (theDataSet2.Tables["Two"].Rows[i3]["nlpNameLevelTwo"].ToString ());
				theSqlDataAdapter3 = new SqlDataAdapter (string.Concat ("SELECT distinct nlpISNLevelThree,nlpNameLevelThree FROM vw_AnalyzeTree WHERE nlp"
				+ "ISNLevelTwo=", theDataSet2.Tables["Two"].Rows[i3]["nlpISNLevelTwo"].ToString (), " and nlpNameLevelthree is not null order by nlpNameLevelThree"), theSqlConnection);
				theDataSet3 = new DataSet ();
				int i15 = theSqlDataAdapter3.Fill (theDataSet3, "Three");
				this.tvBenh.SelectedNode = this.node2;
				i4 = 0;
				goto L_0581;
				
			L_02B3:
				
				{
				}
				this.arrCha.Remove (i3);
				this.tvBenh.SelectedNode = this.node2;
				this.insertChildNode3 (theDataSet3.Tables["Three"].Rows[i4]["nlpNameLevelThree"].ToString (), theDataSet3.Tables["Three"].Rows[i4]);
				int i16 = this.tvBenh.SelectedNode.Nodes.Add (this.node3);
				theSqlDataAdapter4 = new SqlDataAdapter (string.Concat ("SELECT distinct nlpISNLevelFourth,nlpNameLevelFourth FROM vw_AnalyzeTree WHERE n"
				+ "lpISNLevelThree=", theDataSet3.Tables["Three"].Rows[i4]["nlpISNLevelThree"].ToString (), " and nlpNameLevelFourth is not null order by nlpNameLevelFourth"), theSqlConnection);
				theDataSet4 = new DataSet ();
				int i17 = theSqlDataAdapter4.Fill (theDataSet4, "Fouth");
				this.tvBenh.SelectedNode = this.node3;
				i5 = 0;
				goto L_0552;
				
			L_03B3:
				
				{
				}
				this.tvBenh.SelectedNode = this.node3;
				this.insertChildNode4 (theDataSet4.Tables["Fouth"].Rows[i5]["nlpNameLevelFourth"].ToString (), theDataSet4.Tables["Fouth"].Rows[i5]);
				int i18 = this.tvBenh.SelectedNode.Nodes.Add (this.node4);
				theSqlDataAdapter5 = new SqlDataAdapter (string.Concat ("SELECT distinct nlpISNLevelFifth,nlpNameLevelFifth FROM vw_AnalyzeTree WHERE nlp"
				+ "ISNLevelFourth=", theDataSet4.Tables["Fouth"].Rows[i5]["nlpISNLevelFourth"].ToString (), " and nlpNameLevelFifth is not null order by nlpNameLevelFifth"), theSqlConnection);
				theDataSet5 = new DataSet ();
				int i19 = theSqlDataAdapter5.Fill (theDataSet5, "Fifth");
				this.tvBenh.SelectedNode = this.node4;
				i6 = 0;
				goto L_0523;
				
			L_04A1:
				
				{
				}
				this.tvBenh.SelectedNode = this.node4;
				this.insertChildNode5 (theDataSet5.Tables["Fifth"].Rows[i6]["nlpNameLevelFifth"].ToString (), theDataSet5.Tables["Fifth"].Rows[i6]);
				int i20 = this.tvBenh.SelectedNode.Nodes.Add (this.node5);
				i6++;
				
			L_0523:
				
				{
				}
				if (i6 < theDataSet5.Tables["Fifth"].Rows.Count)
				{
					goto L_04A1;
				}
				theSqlDataAdapter5.Dispose ();
				i5++;
				
			L_0552:
				
				{
				}
				if (i5 < theDataSet4.Tables["Fouth"].Rows.Count)
				{
					goto L_03B3;
				}
				theSqlDataAdapter4.Dispose ();
				i4++;
				
			L_0581:
				
				{
				}
				if (i4 < theDataSet3.Tables["Three"].Rows.Count)
				{
					goto L_02B3;
				}
				theSqlDataAdapter3.Dispose ();
				i3++;
				
			L_05B0:
				
				{
				}
				if (i3 < theDataSet2.Tables["Two"].Rows.Count)
				{
					goto L_0170;
				}
				theSqlDataAdapter2.Dispose ();
				i2++;
				
			L_05DF:
				
				{
				}
				if (i2 < this.arrPltISN.Count)
				{
					goto L_00CF;
				}
				theSqlDataAdapter.Dispose ();
				theSqlConnection.Close ();
				this.tvBenh.CollapseAll ();
				
			L_0608:
				return;
			}
			
			[System.STAThreadAttribute ()]
			private static void Main ()
			
			{
				Application.Run (((Form) new frmKQXetNghiem ("1", "Nguyễn Đức Linh", "1660", true)));
				return;
			}
			
			private void tvBenh_DoubleClick (object sender, EventArgs e)
			
			{
				string theString;
				int i;
				MyNode theMyNode;
				string theString2;
				int i2;
				int i3;
				MyNode theMyNode2;
				int i4;
				MyNode theMyNode3;
				MyNode theMyNode4;
				string theString3;
				string theString4;
				string theString5;
				string theString6;
				string theString7;
				theString = string.Empty;
				i = 0;
				goto L_004F;
				
			L_000A:
				
				{
				}
				theMyNode = ((MyNode) this.tvBenh.SelectedNode);
				theString2 = theMyNode.DataRow[0].ToString ();
				if (this.arrISN[i].ToString () == theString2)
				{
					goto L_034E;
				}
				
			L_004B:
				
				{
				}
				i++;
				
			L_004F:
				
				{
				}
				if (i < this.arrISN.Count)
				{
					goto L_000A;
				}
				i2 = 0;
				goto L_0190;
				
			L_0065:
				
				{
				}
				if (this.tvBenh.SelectedNode.Text.ToString () != this.arrPltName[i2].ToString ())
				{
					goto L_00C8;
				}
				this.txtXetNghiem.Text = (theString3 = "");
				this.txtNhom.Text = (theString4 = theString3);
				this.txtYeuCauXetNghiem.Text = theString4;
				goto L_034E;
				
			L_00C8:
				
				{
				}
				i3 = 0;
				goto L_0178;
				
			L_00D0:
				
				{
				}
				if (this.tvBenh.SelectedNode.Text.ToString () != this.arrOng[i3].ToString ())
				{
					goto L_0172;
				}
				theMyNode2 = ((MyNode) this.tvBenh.SelectedNode);
				this.txtXetNghiem.Text = (theString5 = this.tvBenh.SelectedNode.Text.ToString ());
				this.txtNhom.Text = (theString6 = theString5);
				this.txtYeuCauXetNghiem.Text = theString6;
				this.txtISN.Text = theMyNode2.DataRow[0].ToString ();
				goto L_034E;
				
			L_0172:
				
				{
				}
				i3++;
				
			L_0178:
				
				{
				}
				if (i3 < this.arrOng.Count)
				{
					goto L_00D0;
				}
				i2++;
				
			L_0190:
				
				{
				}
				if (i2 < this.arrPltName.Count)
				{
					goto L_0065;
				}
				if (this.tvBenh.SelectedNode.Parent.IsSelected)
				{
					goto L_034E;
				}
				if (this.tvBenh.SelectedNode.Nodes.Count != 0)
				{
					goto L_034E;
				}
				i4 = 0;
				goto L_029E;
				
			L_01DE:
				
				{
				}
				if (this.tvBenh.SelectedNode.Text.ToString () != this.arrCha[i4].ToString ())
				{
					goto L_0298;
				}
				theMyNode3 = ((MyNode) this.tvBenh.SelectedNode);
				this.txtNhom.Text = (theString7 = this.tvBenh.SelectedNode.Text.ToString ());
				this.txtYeuCauXetNghiem.Text = theString7;
				this.txtXetNghiem.Text = this.tvBenh.SelectedNode.Parent.Text.ToString ();
				this.txtISN.Text = theMyNode3.DataRow[0].ToString ();
				goto L_034E;
				
			L_0298:
				
				{
				}
				i4++;
				
			L_029E:
				
				{
				}
				if (i4 < this.arrCha.Count)
				{
					goto L_01DE;
				}
				theMyNode4 = ((MyNode) this.tvBenh.SelectedNode);
				this.txtISN.Text = theMyNode4.DataRow[0].ToString ();
				this.txtYeuCauXetNghiem.Text = this.tvBenh.SelectedNode.Text.ToString ();
				this.txtXetNghiem.Text = this.tvBenh.SelectedNode.Parent.Parent.Text.ToString ();
				this.txtNhom.Text = this.tvBenh.SelectedNode.Parent.Text.ToString ();
				
			L_034E:
				return;
			}
			
			private void txtNhom_KeyPress (object sender, KeyPressEventArgs e)
			
			{
				e.Handled = true;
				return;
			}
			
		#endregion
	}
	
}

